﻿using PostSharp.Aspects;
using PostSharp.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JGSY.SerialCommunication.UpperComputer.Core.AOP
{
    [PSerializable]
    public class ExceptionHandlerAspect : OnExceptionAspect
    {
        public override void OnException(MethodExecutionArgs args)
        {
            Console.WriteLine($"[ExceptionHandler] 捕获到异常: {args.Exception.Message}");
            args.FlowBehavior = FlowBehavior.Continue; // 继续执行
        }
    }

    
}
